# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=kadimus
pkgver=183.ac5f438
pkgrel=1
groups=('blackarch' 'blackarch-webapp' 'blackarch-exploitation'
        'blackarch-scanner')
pkgdesc='LFI Scan & Exploit Tool.'
arch=('x86_64' 'aarch64')
url='https://github.com/P0cL4bs/Kadimus'
license=('MIT')
depends=('curl' 'pcre' 'libssh' 'openssl')
makedepends=('git')
source=("$pkgname::git+https://github.com/P0cL4bs/Kadimus.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|-lssh|-lssh -lcrypto|' Makefile

  #sed -i 's|./resource/|/usr/share/kadimus/resource/|' src/kadimus_xpl.h
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/resource" resource/*
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 license.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

